//
//  ECGFiltersLib.h
//  CPETvhECGService
//
//  Created by moon_zm on 2024/9/12.
//

///心电滤波器管理类
#import <Foundation/Foundation.h>
///封装vhStressTemplLib库(滤波器)（业务使用此类的接口）
NS_ASSUME_NONNULL_BEGIN

///低通滤波器(40Hz-0,70Hz-1,100Hz-2, 关-3)，默认40Hz
typedef NS_ENUM(NSInteger, kECGFreqLowType) {
    kLowType_40 = 0,
    kLowType_70 = 1,
    kLowType_100 = 2,
    kLowType_OFF = 3
};

//工频(50Hz-0,60Hz-1, 关-3)，默认50
typedef NS_ENUM(NSInteger, kECGFreqNotchType) {
    kNotchType_50 = 0,
    kNotchType_60 = 1,
    kNotchType_OFF = 2
};

//肌电滤波,默认strong
typedef NS_ENUM(NSInteger, kECGSmoothType) {
    kSmoothType_OFF = 0,
    kSmoothType_weak = 1,
    kSmoothType_strong = 2
};

@interface ECGFiltersLib : NSObject
@property (nonatomic, assign, readonly) int ecgRate;//采样率
@property (nonatomic, assign, readonly) int freq_low;//低通滤波
@property (nonatomic, assign, readonly) int freq_notch;//工频滤波
@property (nonatomic, assign, readonly) int smoothStrength;//肌电滤波
+ (instancetype)shared;
#pragma mark - 设置心电滤波器参数
///设置滤波器的采样率
- (void)setFilterWithEcgRate:(int)ecgRate;
/// 设置滤波器的滤波参数-设置业务使用，其它地方使用只需要调用上面的属性方法
- (void)setFilterFreqLow:(kECGFreqLowType)freqLow;
- (void)setFilterFreqNotch:(kECGFreqNotchType)freqNotch;
- (void)setFilterFreqMooth:(kECGSmoothType)freqMooth;
/// Do Filters
/// \param data a group 12-lead sampling data or 8-lead. the number of data is the number of leads
///
///
/// returns:
///
/// <ul>
///   <li>
///     filtered data
///   </li>
/// </ul>
- (NSArray<NSNumber *> * _Nullable)filtersWithData:(NSArray<NSNumber *> * _Nonnull)data;
@end

NS_ASSUME_NONNULL_END
